package com.winter.model.vo.check;

import com.google.common.base.Strings;

import com.winter.model.Company;
import com.winter.model.CompanyPosition;
import com.winter.model.FinContentLikeInfo;
import com.winter.model.FinManage;
import com.winter.model.PersonalRelease;
import com.winter.model.vo.request.OfflineRequestVo;
import com.winter.util.Result;
import com.winter.util.ResultCode;

public class CheckParam {

    /**
     * 校验公司职位的参数
     */
    public static String checkPosition(CompanyPosition record) {
        String result = null;
        if (record.getCompanyreleaseId() == null) {
            result = "请选择公司";
        }
        if (Strings.isNullOrEmpty(record.getJobFunction())) {
            result = "请输入职位智能";
        }
        if (Strings.isNullOrEmpty(record.getWorkPlace())) {
            result = "请输入工作地址";
        }
        if (record.getJobCount() == null) {
            result = "请输入招聘人数";
        }
        if (record.getWorkYear() == null) {
            result = "请输入工作年限";
        }
        if (Strings.isNullOrEmpty(record.getEnducation())) {
            result = "请选择学历";
        }
        if (Strings.isNullOrEmpty(record.getSalary())) {
            result = "请输入薪水待遇";
        }
        if (Strings.isNullOrEmpty(record.getJobDescription())) {
            result = "请输入职位描述";
        }
        return result;
    }

    /**
     * 校验公司参数
     */
    public static String checkCompany(Company record) {
        String result = null;
        if (Strings.isNullOrEmpty(record.getCompanyName())) {
            result = "请输入公司名称";
        }
  /*      if (Strings.isNullOrEmpty(record.getOrgPostcode())) {
            result = "请输入公司邮箱";
        }*/
        if (Strings.isNullOrEmpty(record.getChiShortName())) {
            result = "请输入公司简称";
        }
        if (Strings.isNullOrEmpty(record.getCompanyIndustry())) {
            result = "请选择公司行业";
        }
        if (Strings.isNullOrEmpty(record.getCompanyNature())) {
            result = "请选择公司性质";
        }
        if (Strings.isNullOrEmpty(record.getCompanyScale())) {
            result = "请选择公司规模";
        }
        if (Strings.isNullOrEmpty(record.getContacts())) {
            result = "请输入联系人";
        }
        if (Strings.isNullOrEmpty(record.getIntroduction())) {
            result = "请输入公司简介";
        }
        if (Strings.isNullOrEmpty(record.getMobile())) {
            result = "请输入手机";
        }
        if (Strings.isNullOrEmpty(record.getAddress())) {
            result = "请输入地址";
        }
        if (record.getComProId() == null) {
            result = "请选择所在省";
        }
        if (record.getComCityId() == null) {
            result = "请选择所在市";
        }
        return result;
    }

    /**
     * 校验简历参数
     */
    public static String checkPersonal(PersonalRelease record) {
        String result = null;
        if (Strings.isNullOrEmpty(record.getTitle())) {
            result = "请输入简历标题";
        }
        if (Strings.isNullOrEmpty(record.getShowName())) {
            result = "请输入姓名";
        }
        if (Strings.isNullOrEmpty(record.getSex())) {
            result = "请选择性别";
        }
        if (Strings.isNullOrEmpty(record.getHirejob())) {
            result = "请输入期望职位";
        }
        if (Strings.isNullOrEmpty(record.getWorklife())) {
            result = "请选择工作年限";
        }
        if (Strings.isNullOrEmpty(record.getHukou())) {
            result = "请输入户口";
        }
        if (Strings.isNullOrEmpty(record.getCustMobile())) {
            result = "请输入手机号";
        }
        if (Strings.isNullOrEmpty(record.getCustEmail())) {
            result = "请输入邮箱";
        }
        if (Strings.isNullOrEmpty(record.getPoliticalaffiliation())) {
            result = "请输入政治面貌";
        }
        if (Strings.isNullOrEmpty(record.getHomeAddr())) {
            result = "请输入居住地址";
        }
        if (Strings.isNullOrEmpty(record.getEduExpr())) {
            result = "请输入教育经历";
        }
        if (Strings.isNullOrEmpty(record.getWorkExpr())) {
            result = "请输入工作经验";
        }
        if (Strings.isNullOrEmpty(record.getSelfDesc())) {
            result = "请输入自我评价";
        }
        return result;
    }

    public static String checkOffline(OfflineRequestVo offlineRequestVo) {
        String result = null;
        if (offlineRequestVo != null) {
            if (Strings.isNullOrEmpty(offlineRequestVo.getDirect())) {
                result = "请选择方向";
            }
            if (Strings.isNullOrEmpty(offlineRequestVo.getFundMode())) {
                result = "请选择种类";
            }
            if (Strings.isNullOrEmpty(offlineRequestVo.getCcy())) {
                result = "请选择币种";
            }
            if (offlineRequestVo.getDeadline()
                                .size() == 0) {
                result = "请先设置期限";
            }
            if (Strings.isNullOrEmpty(offlineRequestVo.getContact())) {
                result = "请输入联系方式";
            }
        } else {
            result = "参数列表为空";
        }
        return result;
    }

    public static String checkFinManage(FinManage finManage) {
        String result = null;
        if (finManage == null) {
            result = "参数列表为空";
        }
        if (Strings.isNullOrEmpty(finManage.getDirect())) {
            result = "请选择方向";
        }
        if (Strings.isNullOrEmpty(finManage.getFundMode())) {
            result = "请选择保本性质";
        }
        if (Strings.isNullOrEmpty(finManage.getLoi())) {
            result = "请选择保函";
        }
        if (Strings.isNullOrEmpty(finManage.getTermEnd())) {
            result = "请选择期限";
        }
        if (Strings.isNullOrEmpty(finManage.getContact())) {
            result = "请输入联系方式";
        }
        if (Strings.isNullOrEmpty(finManage.getMonBeg()) && Strings.isNullOrEmpty(finManage.getMonEnd())) {
            result = "请输入金额";
        }
        if (Strings.isNullOrEmpty(finManage.getRateEnd()) && Strings.isNullOrEmpty(finManage.getRateBeg())) {
            result = "请输入利率";
        }
        return result;
    }
}